Skip to content

.NET: Add Magentic Orchestration Sample#5823

Merged
lokitoth merged 12 commits into
mainfrom
copilot/port-magentic-orchestration-sample
May 22, 2026
Merged

.NET: Add Magentic Orchestration Sample#5823
lokitoth merged 12 commits into
mainfrom
copilot/port-magentic-orchestration-sample

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 13, 2026

Motivation and Context

Ports the Python Magentic multi-agent orchestration sample to .NET, giving .NET developers a ready-to-run example of the MagenticWorkflowBuilder pattern for coordinating specialized agents on complex analytical tasks.

Description

New Magentic Orchestration Sample

Adds dotnet/samples/03-workflows/Orchestration/Magentic/ — a .NET port of the Python magentic.py workflow sample. The sample builds a MagenticWorkflowBuilder orchestration with three roles:

  • ResearcherAgent – gathers factual background information
  • CoderAgent – uses HostedCodeInterpreterTool for quantitative analysis
  • MagenticManager – plans the work, tracks progress via a ledger, and decides who acts next

Key aspects demonstrated:

  • Building a Magentic workflow with MagenticWorkflowBuilder (max rounds, stalls, resets)
  • Combining standard responses-based agents with a code-interpreter-enabled participant
  • Streaming orchestration events: initial plan, replans, and progress-ledger updates
  • Printing the final multi-agent conversation transcript
  • Graceful PauseIfInteractive that skips when stdin or stdout is redirected (CI-friendly)

Closes #5771

Other Changes

  • Registered the new Magentic.csproj in the solution file
  • Added the sample entry to the 03-workflows/README.md index

Contribution Checklist

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
  • [ ] Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.

Copilot AI and others added 2 commits May 13, 2026 19:03
Copilot AI self-assigned this May 13, 2026
Copilot AI review requested due to automatic review settings May 13, 2026 19:18
Copilot AI review requested due to automatic review settings May 13, 2026 19:18
@moonbox3 moonbox3 added documentation Improvements or additions to documentation .NET workflows Related to Workflows in agent-framework labels May 13, 2026
@github-actions github-actions Bot changed the title Port Magentic orchestration workflow sample to .NET .NET: Port Magentic orchestration workflow sample to .NET May 13, 2026
Copilot AI requested a review from lokitoth May 13, 2026 19:51
Copilot AI requested review from Copilot and removed request for Copilot May 13, 2026 19:56
Copilot AI requested review from Copilot and removed request for Copilot May 13, 2026 19:59
@lokitoth lokitoth marked this pull request as ready for review May 22, 2026 14:45
@lokitoth lokitoth moved this to In Review in Agent Framework May 22, 2026
Comment thread dotnet/agent-framework-dotnet.slnx Outdated
Comment thread dotnet/samples/03-workflows/Orchestration/Magentic/Program.cs Outdated
Comment thread dotnet/samples/03-workflows/Orchestration/Magentic/README.md Outdated
@lokitoth lokitoth added this pull request to the merge queue May 22, 2026
Merged via the queue into main with commit 9fdd742 May 22, 2026
27 checks passed
@github-project-automation github-project-automation Bot moved this from In Review to Done in Agent Framework May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation .NET workflows Related to Workflows in agent-framework

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

.NET: [Feature]: Add a Magentic Orchestration sample

6 participants